Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linting using eslint #406

Merged
merged 3 commits into from
Dec 28, 2016
Merged

Add linting using eslint #406

merged 3 commits into from
Dec 28, 2016

Conversation

LinusU
Copy link
Contributor

@LinusU LinusU commented Dec 25, 2016

I have based the eslint config on standard style, and then disabled the rules that we where breaking. My plan is to enable them back one by one after this gets merged, as to not edit too much of the code base with one pr.

This pr also includes f7aceeb which I guess fixes our first bug that was caught by the linting 🌟 🙌

@LinusU
Copy link
Contributor Author

LinusU commented Dec 25, 2016

ping @jimthedev, any idea why appveyor is failing?

The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

and

Resolve-Path : Cannot find path 'C:\projects\cz-cli\test\artifacts\65fadf84-b742-4197-8b4f-6f2cd9b82963\4c1fa249-620b-4359-9552-3636a9332edf\enduser-app\node_modules\cz-jira-smart-commit\node_modules\inquirer\node_modules\cli-cur
sor\node_modules\restore-cursor\node_modules\exit-hook\package.json' because it does not exist.
At C:\Program Files\AppVeyor\BuildAgent\Modules\build-worker-api\build-worker-api.psm1:207 char:18
+     $fullPath = (Resolve-Path $Path).Path
+                  ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\projects\cz-...ok\package.json:String) [Resolve-Path], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.ResolvePathCommand
 
Push-AppveyorArtifactInternal : Cannot bind argument to parameter 'FullPath' because it is null.
At C:\Program Files\AppVeyor\BuildAgent\Modules\build-worker-api\build-worker-api.psm1:209 char:42
+     Push-AppveyorArtifactInternal -FullPath $fullPath -FileName $File ...
+                                             ~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Push-AppveyorArtifactInternal], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Appveyor.BuildAgent.Api.Utils.PushAppveyorArtifactInternalCmdlet
 
Resolve-Path : Cannot find path 'C:\projects\cz-cli\test\artifacts\65fadf84-b742-4197-8b4f-6f2cd9b82963\4c1fa249-620b-4359-9552-3636a9332edf\enduser-app\node_modules\cz-jira-smart-commit\node_modules\inquirer\node_modules\cli-cur
sor\node_modules\restore-cursor\node_modules\exit-hook\readme.md' because it does not exist.
At C:\Program Files\AppVeyor\BuildAgent\Modules\build-worker-api\build-worker-api.psm1:207 char:18
+     $fullPath = (Resolve-Path $Path).Path
+                  ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\projects\cz-...-hook\readme.md:String) [Resolve-Path], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.ResolvePathCommand
 
Push-AppveyorArtifactInternal : Cannot bind argument to parameter 'FullPath' because it is null.
At C:\Program Files\AppVeyor\BuildAgent\Modules\build-worker-api\build-worker-api.psm1:209 char:42
+     Push-AppveyorArtifactInternal -FullPath $fullPath -FileName $File ...
+                                             ~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Push-AppveyorArtifactInternal], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Appveyor.BuildAgent.Api.Utils.PushAppveyorArtifactInternalCmdlet

If you could quickly explain what this is for in the appveyor.yml file, that would be appreciated :)

on_finish:
  - ps: $root = Resolve-Path .\test\artifacts; [IO.Directory]::GetFiles($root.Path, '*.*', 'AllDirectories') | % { Push-AppveyorArtifact $_ -FileName $_.Substring($root.Path.Length + 1) -DeploymentName to-publish }

artifacts:
  - path: test/artifacts/**/*
    name: test artifacts

Also, are you 👍 or 👎 on eslint? :)

@jimthedev
Copy link
Member

@LinusU Love this PR. BTW, happy holidays and thank you so much for all the hard work you do on Commitizen. You've been a huge asset. If I can be a reference or anything, let me know.

Yes I <3 eslint. I'm more a fan of semistandard since I <3 semicolons but I am sure I could make it work. I think appveyor is failing because we're using npm2 and not 3. Npm 3 flattens the folder structure but 2 doesn't. It means that eventually you run into this issue on windows. Basically it means we can't support npm2 anymore on windows since the dependency structure is too deep. Perhaps we should just drop npm2 support since npm3 has been around a long time. We could do this in Commitizen 3.0?

@LinusU
Copy link
Contributor Author

LinusU commented Dec 26, 2016

Thank you! I love helping out <3

I'm still trying to figure out exactly how this all ties together. I'm thinking that since I've only added devDependencies it shouldn't affect the actual published product...

As I've understood it, we are releasing via Travis CI, so what are the artifacts from Appveyor used for?

@jimthedev
Copy link
Member

Good question about those lines in appveyor.yml. Basically they let us keep the files created as a result of running the tests so that we can inspect the contents of the test artifacts, the git status of the repos, etc. I removed those lines for now and master is now passing in both environments. If you merge master into your branch then your appveyor tests should pass. Eventually I'd like to make it so that we can turn on and off artifact collection by an environment variable in the Appveyor UI.

@jimthedev jimthedev closed this Dec 27, 2016
@jimthedev jimthedev reopened this Dec 27, 2016
@jimthedev
Copy link
Member

Sorry. Hit the wrong button on mobile.

@LinusU LinusU merged commit 852d6f6 into commitizen:master Dec 28, 2016
@LinusU
Copy link
Contributor Author

LinusU commented Dec 28, 2016

Amazing 🙌 thanks for all the help

@LinusU LinusU deleted the linting branch December 28, 2016 22:34
jimthedev added a commit that referenced this pull request Jan 2, 2017
* master:
  fix(package): "main" property within "package.json" (#409)
  style: Add linting using eslint (#406)
  ci(appveyor): remove appveyor on finish script
  ci(appveyor): disable collection of artifacts
  ci(tests): on windows run tests as node4/npm3
  ci(travis): update semantic-release to 6.3.5 and update travis config
  chore(package): update nyc to version 10.0.0 (#392)
  docs(install): Add documentation for installing and running locally (#300)
  fix(tests): fix tests when a global config is present (#405)
  test(adapter): add test for scoped npm modules
  fix(adapter): add support for scoped adapters
  docs: Add cz-emoji to tools list (#404)
  feat(commit): use OS-specific cache dir for commitizen.json instead of home-or-tmp (#400)
  fix(npmignore): ignore more unnecessary files (#393)
  docs: add vscode-commitizen to tools list (#397)
  Ci issues with commits (#402)
  chore(ci): add node versions and say git version in ci
  docs: replace sudo mention with link to how to fix EACCES error
jimthedev added a commit that referenced this pull request Jan 2, 2017
* master: (25 commits)
  chore(package): update lodash to version 4.17.2 (#389)
  chore(package): update ghooks to version 1.3.2 (#277)
  chore(package): update babel-preset-stage-2 to version 6.18.0 (#371)
  chore(package): update babel-preset-es2015 to version 6.18.0 (#370)
  chore(package): update babel-cli to version 6.18.0 (#369)
  chore(package): update axios to version 0.15.2 (#366)
  chore(package): update find-node-modules to version 1.0.4 (#346)
  fix(package): "main" property within "package.json" (#409)
  style: Add linting using eslint (#406)
  ci(appveyor): remove appveyor on finish script
  ci(appveyor): disable collection of artifacts
  ci(tests): on windows run tests as node4/npm3
  ci(travis): update semantic-release to 6.3.5 and update travis config
  chore(package): update nyc to version 10.0.0 (#392)
  docs(install): Add documentation for installing and running locally (#300)
  fix(tests): fix tests when a global config is present (#405)
  test(adapter): add test for scoped npm modules
  fix(adapter): add support for scoped adapters
  docs: Add cz-emoji to tools list (#404)
  feat(commit): use OS-specific cache dir for commitizen.json instead of home-or-tmp (#400)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants